export const toThousands = num => {
    let number = Number(num)
    if (Object.prototype.toString.call(num) !== '[object Number]') {
        console.log('num 必须是数字')
    }
    if (number % 1 === 0) {
        return (number || 0).toString().replace(/(\d)(?=(?:\d{3})+$)/g, '$1,')
    }

    return Number(number)
        .toFixed(2)
        .replace(/(\d)(?=(\d{3})+\.)/g, '$1,')
}
export const orderstatus = (status) => {
    if (status === 'waitpay') {
        return '待付款';
    }
    if (status === 'waitship') {
        return '待发货';
    }
    if (status === 'waitreceive') {
        return '待收货';
    }
    if (status === 'finish') {
        return '交易完成';
    }
    if (status === 'cancle') {
        return '交易取消';
    }
    if (status === 'close') {
        return '交易关闭';
    }
    if (status === 'returnfee') {
        return '退货';
    }
}